import { BasicForm } from '@/components/ProForm/interface/index';

import { defaultStyle } from '@/basic/style';
import { File } from '@/api/interface/file';

export function useFileForm() {
  let addFileForm = reactive<BasicForm>({
    form: {
      formType: '',
      formId: '',
      fileName: '',
      fileSuffix: '',
      fileByMultipart: ''
    },
    title: '',
    visible: false,
    transitionArr: [],
    options: [
      {
        type: 'input',
        hide: true,
        label: '后缀',
        prop: 'fileSuffix'
      },
      {
        type: 'input',
        hide: false,
        label: '文件名称',
        prop: 'fileName',
        attrs: {
          placeholder: '文件名(不输入默认为上传文件名)'
        },
        rules: [
          {
            required: true,
            message: '文件名称',
            trigger: 'change'
          }
        ]
      },
      {
        type: 'input',
        hide: false,
        prop: 'remark',
        label: 'remark',
        attrs: {
          style: defaultStyle
        }
      }
    ]
  });

  return { addFileForm };
}
